package com.lagou.ipersistence.executor.statement;

import com.lagou.ipersistence.executor.parameter.ParameterHandler;
import com.lagou.ipersistence.mapping.BoundSql;
import com.lagou.ipersistence.session.ResultHandler;

import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.List;

/**
 * @author Yan Jiahong
 * Created on 2020/11/22
 */
public interface StatementHandler {
    Statement prepare(Connection connection, Integer transactionTimeout) throws SQLException;
    
    void parameterize(Statement statement) throws SQLException;
    
    <E> List<E> query(Statement statement, ResultHandler<?> resultHandler) throws SQLException;
    
    BoundSql getBoundSql();
    
    ParameterHandler getParameterHandler();
    
    int update(Statement stmt) throws SQLException;
}
